package com.woniu.controller;

import com.woniu.entity.Admin;
import com.woniu.entity.News;
import com.woniu.mapper.AdminMapper;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class AdminController {

    @Autowired
    private  AdminMapper adminMapper;

    @RequestMapping(value = "/admin/add" , method = RequestMethod.POST)
    public String addNews(@RequestBody Admin data) {
        if(adminMapper.insert(data)==0){
            return "添加失败";
        }

        return "添加成功";
    }
}
